/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Chiabai_total;

import heartnew.Card;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.Icon;
import javax.swing.ImageIcon;

/**
 *
 * @author Oho
 */
public class OpenCard extends Thread{
     ArrayList<Card> arr;//danh sach bai dang cam cua nguoi choi 13 la
     ArrayList<RotatedJLabel> rbt;// 13 la bai tuong ung 
     public OpenCard( ArrayList<Card> arr,ArrayList<RotatedJLabel>rbt)
     {
     this.arr=arr;
     this.rbt = rbt;
     }
    public void run()
    {
     for (int i = 0; i < 13; i++) {
            try {
                arr.get(i).getNumber();
                rbt.get(i).setRank(arr.get(i).getRank());
                rbt.get(i).setNumber(arr.get(i).getNumber());
                Icon icon = new ImageIcon("c:/abc/"+arr.get(i).getNumber()+"."+arr.get(i).getRank()+".jpg");
                rbt.get(i).setIcon(icon);
                
                this.sleep(100);
            } catch (InterruptedException ex) {
                Logger.getLogger(OpenCard.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
    
}
